<%@ page language="java" pageEncoding="UTF-8"%>
<%@ include file="../back-common.jsp"%>
<%@ include file="/WEB-INF/pages/common/taglib.jsp"%>

<%@ taglib uri="http://displaytag.sf.net" prefix="display"%>

<script src="<ls:templateResource item='/resources/plugins/My97DatePicker/WdatePicker.js'/>" type="text/javascript"></script>

    <form:form  action="${contextPath}/admin/event/query" id="form1" method="get">
        <table class="${tableclass}" style="width: 100%">
		    <thead>
		    	<tr><th> <strong class="am-text-primary am-text-lg">系统管理</strong> /  系统日志</th></tr>
		    </thead> 
		    <tbody><tr><td>
				<input type="hidden" id="curPageNO" name="curPageNO" value="${curPageNO}" />
				<div align="left" style="padding: 5px;">
							&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;操作人<input type="text" name="modifyUser" maxlength="50" value="${event.modifyUser}" class="${inputclass}" />&nbsp;
            					用户名称<input type="text" name="userName" maxlength="50" value="${event.userName}" class="${inputclass}" />&nbsp;
            					对象<input type="text" name="type" maxlength="50" value="${event.type}" class="${inputclass}" />
				</div>
				<div align="left" style="padding: 5px;">
				            &nbsp;开始时间
							 <input readonly="readonly"  name="startTime" id="startTime" class="Wdate" type="text" onClick="WdatePicker()" value='<fmt:formatDate value="${event.startTime}" pattern="yyyy-MM-dd"/>' />
							&nbsp;结束时间 
							 <input readonly="readonly" name="endTime" id="endTime" class="Wdate" type="text" onClick="WdatePicker()" value='<fmt:formatDate value="${event.endTime}" pattern="yyyy-MM-dd"/>' />
				            <input type="button" onclick="search()" value="搜索" class="${btnclass}" />
				</div>
 </td></tr></tbody>
	    </table>
    </form:form>
    <div align="center">
          <%@ include file="/WEB-INF/pages/common/messages.jsp"%>
          <c:if test="${not empty requestScope.list }">
			  <display:table name="list" requestURI="/admin/event/query" id="item" export="false" class="${tableclass}" style="width:100%">
			  <display:column title="操作人" property="modifyUser"></display:column>
		      <display:column title="用户名称" property="userName"></display:column>
		      <display:column title="对象" property="type"></display:column>
		      <display:column title="类型" property="operation"></display:column>
		      <display:column title="对应类型的ID" property="relateId"></display:column>
		      <display:column title="时间" property="createTime" sortable="true" sortName="createTime" format="{0,date,yyyy-MM-dd HH:mm:ss}" ></display:column>
		    <display:column title="操作" media="html" style="width: 60px">
			       <div class="am-btn-toolbar">
		                  <div class="am-btn-group am-btn-group-xs">
		                    <button class="am-btn am-btn-default am-btn-xs am-text-secondary" onclick="window.location='<ls:url address='/admin/event/load/${item.eventId}'/>'"><span class="am-icon-search"></span> 查看</button>
		                  </div>
		           </div>
		      </display:column>
		    </display:table>
	    </c:if>
	    <c:if test="${empty requestScope.list }">
	    	<div>找不到符合条件的记录!</div>
	    </c:if>
        <ls:page pageSize="${pageSize }"  total="${total}" curPageNO="${curPageNO }"  type="default"/>
    </div>
        <script language="JavaScript" type="text/javascript">
			highlightTableRows("item");
			function search(){
			  	$("#form1 #curPageNO").val("1");//只要是搜索,都是从第一页开始查
			  	$("#form1")[0].submit();
			}
		</script>



